package org.secangkirkopipanas.gxtcore.server.service.impl;

import java.util.List;

import org.secangkirkopipanas.gxtcore.common.exception.DataNotFoundException;
import org.secangkirkopipanas.gxtcore.server.dao.ISystemGroupDAO;
import org.secangkirkopipanas.gxtcore.server.domain.SystemGroup;
import org.secangkirkopipanas.gxtcore.server.domain.SystemUser;
import org.secangkirkopipanas.gxtcore.server.service.ISystemGroupService;

public class SystemGroupService implements ISystemGroupService {

	private ISystemGroupDAO systemGroupDAO;

	public ISystemGroupDAO getSystemGroupDAO() {
		return systemGroupDAO;
	}

	public void setSystemGroupDAO(ISystemGroupDAO systemGroupDAO) {
		this.systemGroupDAO = systemGroupDAO;
	}

	public void add(SystemGroup systemGroup) {
		systemGroupDAO.add(systemGroup);
	}

	public void delete(SystemGroup systemGroup) throws DataNotFoundException {
		systemGroupDAO.delete(systemGroup);
	}

	public void delete(String groupName) throws DataNotFoundException {
		systemGroupDAO.delete(groupName);
	}

	public SystemGroup get(long systemGroupId) {
		return systemGroupDAO.get(systemGroupId);
	}

	public SystemGroup get(String systemGroupName) {
		return systemGroupDAO.get(systemGroupName);
	}

	public List<SystemGroup> getForList() {
		return systemGroupDAO.getForList();
	}

	public List<SystemUser> getGroupMembers(SystemGroup systemGroup) {
		return systemGroupDAO.getGroupMembers(systemGroup);
	}

	public int getTotalCount() {
		return systemGroupDAO.getTotalCount();
	}

}
